//
//  TFluckyBag.swift
//  TalkfunSDKDemo
//
//  Created by 莫瑞权 on 2023/10/13.
//  Copyright © 2023 Talkfun. All rights reserved.
//

import UIKit

class TFluckyBag: UIView {

    let image = UIImageView()
    let title = UILabel()
    override init(frame: CGRect) {
        super.init(frame: frame)

        self.addSubview(image)
        image.image = UIImage(named: "HTLive.bundle/fudai-big")
        self.addSubview(title)

        let attrString = NSMutableAttributedString(string: "04:59")
     
        title.numberOfLines = 0
        
        let attr: [NSAttributedString.Key : Any] = [.font: UIFont.PingFang(size: 12),.foregroundColor: UIColor(red: 255, green: 255, blue: 255, alpha: 1)]
        attrString.addAttributes(attr, range: NSRange(location: 0, length: attrString.length))
        title.attributedText = attrString
        self.addSubview(title)
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        
        image.frame = self.bounds
        
        title.frame = CGRect(x: 0, y: self.frame.height-17, width: 32, height: 17)
    }
    

}
